//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension ECR {
    // MARK: Enums

    public enum EncryptionType: String, CustomStringConvertible, Codable, _SotoSendable {
        case aes256 = "AES256"
        case kms = "KMS"
        public var description: String { return self.rawValue }
    }

    public enum FindingSeverity: String, CustomStringConvertible, Codable, _SotoSendable {
        case critical = "CRITICAL"
        case high = "HIGH"
        case informational = "INFORMATIONAL"
        case low = "LOW"
        case medium = "MEDIUM"
        case undefined = "UNDEFINED"
        public var description: String { return self.rawValue }
    }

    public enum ImageActionType: String, CustomStringConvertible, Codable, _SotoSendable {
        case expire = "EXPIRE"
        public var description: String { return self.rawValue }
    }

    public enum ImageFailureCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case imageNotFound = "ImageNotFound"
        case imageReferencedByManifestList = "ImageReferencedByManifestList"
        case imageTagDoesNotMatchDigest = "ImageTagDoesNotMatchDigest"
        case invalidImageDigest = "InvalidImageDigest"
        case invalidImageTag = "InvalidImageTag"
        case kmsError = "KmsError"
        case missingDigestAndTag = "MissingDigestAndTag"
        public var description: String { return self.rawValue }
    }

    public enum ImageTagMutability: String, CustomStringConvertible, Codable, _SotoSendable {
        case immutable = "IMMUTABLE"
        case mutable = "MUTABLE"
        public var description: String { return self.rawValue }
    }

    public enum LayerAvailability: String, CustomStringConvertible, Codable, _SotoSendable {
        case available = "AVAILABLE"
        case unavailable = "UNAVAILABLE"
        public var description: String { return self.rawValue }
    }

    public enum LayerFailureCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case invalidLayerDigest = "InvalidLayerDigest"
        case missingLayerDigest = "MissingLayerDigest"
        public var description: String { return self.rawValue }
    }

    public enum LifecyclePolicyPreviewStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case complete = "COMPLETE"
        case expired = "EXPIRED"
        case failed = "FAILED"
        case inProgress = "IN_PROGRESS"
        public var description: String { return self.rawValue }
    }

    public enum ReplicationStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case complete = "COMPLETE"
        case failed = "FAILED"
        case inProgress = "IN_PROGRESS"
        public var description: String { return self.rawValue }
    }

    public enum RepositoryFilterType: String, CustomStringConvertible, Codable, _SotoSendable {
        case prefixMatch = "PREFIX_MATCH"
        public var description: String { return self.rawValue }
    }

    public enum ScanFrequency: String, CustomStringConvertible, Codable, _SotoSendable {
        case continuousScan = "CONTINUOUS_SCAN"
        case manual = "MANUAL"
        case scanOnPush = "SCAN_ON_PUSH"
        public var description: String { return self.rawValue }
    }

    public enum ScanStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case complete = "COMPLETE"
        case failed = "FAILED"
        case findingsUnavailable = "FINDINGS_UNAVAILABLE"
        case inProgress = "IN_PROGRESS"
        case pending = "PENDING"
        case scanEligibilityExpired = "SCAN_ELIGIBILITY_EXPIRED"
        case unsupportedImage = "UNSUPPORTED_IMAGE"
        public var description: String { return self.rawValue }
    }

    public enum ScanType: String, CustomStringConvertible, Codable, _SotoSendable {
        case basic = "BASIC"
        case enhanced = "ENHANCED"
        public var description: String { return self.rawValue }
    }

    public enum ScanningConfigurationFailureCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case repositoryNotFound = "REPOSITORY_NOT_FOUND"
        public var description: String { return self.rawValue }
    }

    public enum ScanningRepositoryFilterType: String, CustomStringConvertible, Codable, _SotoSendable {
        case wildcard = "WILDCARD"
        public var description: String { return self.rawValue }
    }

    public enum TagStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case any = "ANY"
        case tagged = "TAGGED"
        case untagged = "UNTAGGED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct Attribute: AWSDecodableShape {
        /// The attribute key.
        public let key: String
        /// The value assigned to the attribute key.
        public let value: String?

        public init(key: String, value: String? = nil) {
            self.key = key
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case key
            case value
        }
    }

    public struct AuthorizationData: AWSDecodableShape {
        /// A base64-encoded string that contains authorization data for the specified Amazon ECR registry. When the string is decoded, it is presented in the format user:password for private registry authentication using docker login.
        public let authorizationToken: String?
        /// The Unix time in seconds and milliseconds when the authorization token expires. Authorization tokens are valid for 12 hours.
        public let expiresAt: Date?
        /// The registry URL to use for this authorization token in a docker login command. The Amazon ECR registry URL format is https://aws_account_id.dkr.ecr.region.amazonaws.com. For example, https://012345678910.dkr.ecr.us-east-1.amazonaws.com..
        public let proxyEndpoint: String?

        public init(authorizationToken: String? = nil, expiresAt: Date? = nil, proxyEndpoint: String? = nil) {
            self.authorizationToken = authorizationToken
            self.expiresAt = expiresAt
            self.proxyEndpoint = proxyEndpoint
        }

        private enum CodingKeys: String, CodingKey {
            case authorizationToken
            case expiresAt
            case proxyEndpoint
        }
    }

    public struct AwsEcrContainerImageDetails: AWSDecodableShape {
        /// The architecture of the Amazon ECR container image.
        public let architecture: String?
        /// The image author of the Amazon ECR container image.
        public let author: String?
        /// The image hash of the Amazon ECR container image.
        public let imageHash: String?
        /// The image tags attached to the Amazon ECR container image.
        public let imageTags: [String]?
        /// The platform of the Amazon ECR container image.
        public let platform: String?
        /// The date and time the Amazon ECR container image was pushed.
        public let pushedAt: Date?
        /// The registry the Amazon ECR container image belongs to.
        public let registry: String?
        /// The name of the repository the Amazon ECR container image resides in.
        public let repositoryName: String?

        public init(architecture: String? = nil, author: String? = nil, imageHash: String? = nil, imageTags: [String]? = nil, platform: String? = nil, pushedAt: Date? = nil, registry: String? = nil, repositoryName: String? = nil) {
            self.architecture = architecture
            self.author = author
            self.imageHash = imageHash
            self.imageTags = imageTags
            self.platform = platform
            self.pushedAt = pushedAt
            self.registry = registry
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case architecture
            case author
            case imageHash
            case imageTags
            case platform
            case pushedAt
            case registry
            case repositoryName
        }
    }

    public struct BatchCheckLayerAvailabilityRequest: AWSEncodableShape {
        /// The digests of the image layers to check.
        public let layerDigests: [String]
        /// The Amazon Web Services account ID associated with the registry that contains the image layers to check. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository that is associated with the image layers to check.
        public let repositoryName: String

        public init(layerDigests: [String], registryId: String? = nil, repositoryName: String) {
            self.layerDigests = layerDigests
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.layerDigests.forEach {
                try validate($0, name: "layerDigests[]", parent: name, max: 1000)
            }
            try self.validate(self.layerDigests, name: "layerDigests", parent: name, max: 100)
            try self.validate(self.layerDigests, name: "layerDigests", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case layerDigests
            case registryId
            case repositoryName
        }
    }

    public struct BatchCheckLayerAvailabilityResponse: AWSDecodableShape {
        /// Any failures associated with the call.
        public let failures: [LayerFailure]?
        /// A list of image layer objects corresponding to the image layer references in the request.
        public let layers: [Layer]?

        public init(failures: [LayerFailure]? = nil, layers: [Layer]? = nil) {
            self.failures = failures
            self.layers = layers
        }

        private enum CodingKeys: String, CodingKey {
            case failures
            case layers
        }
    }

    public struct BatchDeleteImageRequest: AWSEncodableShape {
        /// A list of image ID references that correspond to images to delete. The format of the imageIds reference is imageTag=tag or imageDigest=digest.
        public let imageIds: [ImageIdentifier]
        /// The Amazon Web Services account ID associated with the registry that contains the image to delete. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The repository that contains the image to delete.
        public let repositoryName: String

        public init(imageIds: [ImageIdentifier], registryId: String? = nil, repositoryName: String) {
            self.imageIds = imageIds
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.imageIds.forEach {
                try $0.validate(name: "\(name).imageIds[]")
            }
            try self.validate(self.imageIds, name: "imageIds", parent: name, max: 100)
            try self.validate(self.imageIds, name: "imageIds", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case imageIds
            case registryId
            case repositoryName
        }
    }

    public struct BatchDeleteImageResponse: AWSDecodableShape {
        /// Any failures associated with the call.
        public let failures: [ImageFailure]?
        /// The image IDs of the deleted images.
        public let imageIds: [ImageIdentifier]?

        public init(failures: [ImageFailure]? = nil, imageIds: [ImageIdentifier]? = nil) {
            self.failures = failures
            self.imageIds = imageIds
        }

        private enum CodingKeys: String, CodingKey {
            case failures
            case imageIds
        }
    }

    public struct BatchGetImageRequest: AWSEncodableShape {
        /// The accepted media types for the request. Valid values: application/vnd.docker.distribution.manifest.v1+json | application/vnd.docker.distribution.manifest.v2+json | application/vnd.oci.image.manifest.v1+json
        public let acceptedMediaTypes: [String]?
        /// A list of image ID references that correspond to images to describe. The format of the imageIds reference is imageTag=tag or imageDigest=digest.
        public let imageIds: [ImageIdentifier]
        /// The Amazon Web Services account ID associated with the registry that contains the images to describe. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The repository that contains the images to describe.
        public let repositoryName: String

        public init(acceptedMediaTypes: [String]? = nil, imageIds: [ImageIdentifier], registryId: String? = nil, repositoryName: String) {
            self.acceptedMediaTypes = acceptedMediaTypes
            self.imageIds = imageIds
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.acceptedMediaTypes, name: "acceptedMediaTypes", parent: name, max: 100)
            try self.validate(self.acceptedMediaTypes, name: "acceptedMediaTypes", parent: name, min: 1)
            try self.imageIds.forEach {
                try $0.validate(name: "\(name).imageIds[]")
            }
            try self.validate(self.imageIds, name: "imageIds", parent: name, max: 100)
            try self.validate(self.imageIds, name: "imageIds", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case acceptedMediaTypes
            case imageIds
            case registryId
            case repositoryName
        }
    }

    public struct BatchGetImageResponse: AWSDecodableShape {
        /// Any failures associated with the call.
        public let failures: [ImageFailure]?
        /// A list of image objects corresponding to the image references in the request.
        public let images: [Image]?

        public init(failures: [ImageFailure]? = nil, images: [Image]? = nil) {
            self.failures = failures
            self.images = images
        }

        private enum CodingKeys: String, CodingKey {
            case failures
            case images
        }
    }

    public struct BatchGetRepositoryScanningConfigurationRequest: AWSEncodableShape {
        /// One or more repository names to get the scanning configuration for.
        public let repositoryNames: [String]

        public init(repositoryNames: [String]) {
            self.repositoryNames = repositoryNames
        }

        public func validate(name: String) throws {
            try self.repositoryNames.forEach {
                try validate($0, name: "repositoryNames[]", parent: name, max: 256)
                try validate($0, name: "repositoryNames[]", parent: name, min: 2)
                try validate($0, name: "repositoryNames[]", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
            }
            try self.validate(self.repositoryNames, name: "repositoryNames", parent: name, max: 25)
            try self.validate(self.repositoryNames, name: "repositoryNames", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case repositoryNames
        }
    }

    public struct BatchGetRepositoryScanningConfigurationResponse: AWSDecodableShape {
        /// Any failures associated with the call.
        public let failures: [RepositoryScanningConfigurationFailure]?
        /// The scanning configuration for the requested repositories.
        public let scanningConfigurations: [RepositoryScanningConfiguration]?

        public init(failures: [RepositoryScanningConfigurationFailure]? = nil, scanningConfigurations: [RepositoryScanningConfiguration]? = nil) {
            self.failures = failures
            self.scanningConfigurations = scanningConfigurations
        }

        private enum CodingKeys: String, CodingKey {
            case failures
            case scanningConfigurations
        }
    }

    public struct CompleteLayerUploadRequest: AWSEncodableShape {
        /// The sha256 digest of the image layer.
        public let layerDigests: [String]
        /// The Amazon Web Services account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository to associate with the image layer.
        public let repositoryName: String
        /// The upload ID from a previous InitiateLayerUpload operation to associate with the image layer.
        public let uploadId: String

        public init(layerDigests: [String], registryId: String? = nil, repositoryName: String, uploadId: String) {
            self.layerDigests = layerDigests
            self.registryId = registryId
            self.repositoryName = repositoryName
            self.uploadId = uploadId
        }

        public func validate(name: String) throws {
            try self.layerDigests.forEach {
                try validate($0, name: "layerDigests[]", parent: name, pattern: "^[a-zA-Z0-9-_+.]+:[a-fA-F0-9]+$")
            }
            try self.validate(self.layerDigests, name: "layerDigests", parent: name, max: 100)
            try self.validate(self.layerDigests, name: "layerDigests", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
            try self.validate(self.uploadId, name: "uploadId", parent: name, pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case layerDigests
            case registryId
            case repositoryName
            case uploadId
        }
    }

    public struct CompleteLayerUploadResponse: AWSDecodableShape {
        /// The sha256 digest of the image layer.
        public let layerDigest: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?
        /// The upload ID associated with the layer.
        public let uploadId: String?

        public init(layerDigest: String? = nil, registryId: String? = nil, repositoryName: String? = nil, uploadId: String? = nil) {
            self.layerDigest = layerDigest
            self.registryId = registryId
            self.repositoryName = repositoryName
            self.uploadId = uploadId
        }

        private enum CodingKeys: String, CodingKey {
            case layerDigest
            case registryId
            case repositoryName
            case uploadId
        }
    }

    public struct CreatePullThroughCacheRuleRequest: AWSEncodableShape {
        /// The repository name prefix to use when caching images from the source registry.
        public let ecrRepositoryPrefix: String
        /// The Amazon Web Services account ID associated with the registry to create the pull through cache rule for. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The registry URL of the upstream public registry to use as the source for the pull through cache rule.
        public let upstreamRegistryUrl: String

        public init(ecrRepositoryPrefix: String, registryId: String? = nil, upstreamRegistryUrl: String) {
            self.ecrRepositoryPrefix = ecrRepositoryPrefix
            self.registryId = registryId
            self.upstreamRegistryUrl = upstreamRegistryUrl
        }

        public func validate(name: String) throws {
            try self.validate(self.ecrRepositoryPrefix, name: "ecrRepositoryPrefix", parent: name, max: 20)
            try self.validate(self.ecrRepositoryPrefix, name: "ecrRepositoryPrefix", parent: name, min: 2)
            try self.validate(self.ecrRepositoryPrefix, name: "ecrRepositoryPrefix", parent: name, pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$")
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case ecrRepositoryPrefix
            case registryId
            case upstreamRegistryUrl
        }
    }

    public struct CreatePullThroughCacheRuleResponse: AWSDecodableShape {
        /// The date and time, in JavaScript date format, when the pull through cache rule was created.
        public let createdAt: Date?
        /// The Amazon ECR repository prefix associated with the pull through cache rule.
        public let ecrRepositoryPrefix: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The upstream registry URL associated with the pull through cache rule.
        public let upstreamRegistryUrl: String?

        public init(createdAt: Date? = nil, ecrRepositoryPrefix: String? = nil, registryId: String? = nil, upstreamRegistryUrl: String? = nil) {
            self.createdAt = createdAt
            self.ecrRepositoryPrefix = ecrRepositoryPrefix
            self.registryId = registryId
            self.upstreamRegistryUrl = upstreamRegistryUrl
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt
            case ecrRepositoryPrefix
            case registryId
            case upstreamRegistryUrl
        }
    }

    public struct CreateRepositoryRequest: AWSEncodableShape {
        /// The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
        public let encryptionConfiguration: EncryptionConfiguration?
        /// The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
        public let imageScanningConfiguration: ImageScanningConfiguration?
        /// The tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.
        public let imageTagMutability: ImageTagMutability?
        /// The Amazon Web Services account ID associated with the registry to create the repository. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app).
        public let repositoryName: String
        /// The metadata that you apply to the repository to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
        public let tags: [Tag]?

        public init(encryptionConfiguration: EncryptionConfiguration? = nil, imageScanningConfiguration: ImageScanningConfiguration? = nil, imageTagMutability: ImageTagMutability? = nil, registryId: String? = nil, repositoryName: String, tags: [Tag]? = nil) {
            self.encryptionConfiguration = encryptionConfiguration
            self.imageScanningConfiguration = imageScanningConfiguration
            self.imageTagMutability = imageTagMutability
            self.registryId = registryId
            self.repositoryName = repositoryName
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.encryptionConfiguration?.validate(name: "\(name).encryptionConfiguration")
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case encryptionConfiguration
            case imageScanningConfiguration
            case imageTagMutability
            case registryId
            case repositoryName
            case tags
        }
    }

    public struct CreateRepositoryResponse: AWSDecodableShape {
        /// The repository that was created.
        public let repository: Repository?

        public init(repository: Repository? = nil) {
            self.repository = repository
        }

        private enum CodingKeys: String, CodingKey {
            case repository
        }
    }

    public struct CvssScore: AWSDecodableShape {
        /// The base CVSS score used for the finding.
        public let baseScore: Double?
        /// The vector string of the CVSS score.
        public let scoringVector: String?
        /// The source of the CVSS score.
        public let source: String?
        /// The version of CVSS used for the score.
        public let version: String?

        public init(baseScore: Double? = nil, scoringVector: String? = nil, source: String? = nil, version: String? = nil) {
            self.baseScore = baseScore
            self.scoringVector = scoringVector
            self.source = source
            self.version = version
        }

        private enum CodingKeys: String, CodingKey {
            case baseScore
            case scoringVector
            case source
            case version
        }
    }

    public struct CvssScoreAdjustment: AWSDecodableShape {
        /// The metric used to adjust the CVSS score.
        public let metric: String?
        /// The reason the CVSS score has been adjustment.
        public let reason: String?

        public init(metric: String? = nil, reason: String? = nil) {
            self.metric = metric
            self.reason = reason
        }

        private enum CodingKeys: String, CodingKey {
            case metric
            case reason
        }
    }

    public struct CvssScoreDetails: AWSDecodableShape {
        /// An object that contains details about adjustment Amazon Inspector made to the CVSS score.
        public let adjustments: [CvssScoreAdjustment]?
        /// The CVSS score.
        public let score: Double?
        /// The source for the CVSS score.
        public let scoreSource: String?
        /// The vector for the CVSS score.
        public let scoringVector: String?
        /// The CVSS version used in scoring.
        public let version: String?

        public init(adjustments: [CvssScoreAdjustment]? = nil, score: Double? = nil, scoreSource: String? = nil, scoringVector: String? = nil, version: String? = nil) {
            self.adjustments = adjustments
            self.score = score
            self.scoreSource = scoreSource
            self.scoringVector = scoringVector
            self.version = version
        }

        private enum CodingKeys: String, CodingKey {
            case adjustments
            case score
            case scoreSource
            case scoringVector
            case version
        }
    }

    public struct DeleteLifecyclePolicyRequest: AWSEncodableShape {
        /// The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository.
        public let repositoryName: String

        public init(registryId: String? = nil, repositoryName: String) {
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case registryId
            case repositoryName
        }
    }

    public struct DeleteLifecyclePolicyResponse: AWSDecodableShape {
        /// The time stamp of the last time that the lifecycle policy was run.
        public let lastEvaluatedAt: Date?
        /// The JSON lifecycle policy text.
        public let lifecyclePolicyText: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(lastEvaluatedAt: Date? = nil, lifecyclePolicyText: String? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.lastEvaluatedAt = lastEvaluatedAt
            self.lifecyclePolicyText = lifecyclePolicyText
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case lastEvaluatedAt
            case lifecyclePolicyText
            case registryId
            case repositoryName
        }
    }

    public struct DeletePullThroughCacheRuleRequest: AWSEncodableShape {
        /// The Amazon ECR repository prefix associated with the pull through cache rule to delete.
        public let ecrRepositoryPrefix: String
        /// The Amazon Web Services account ID associated with the registry that contains the pull through cache rule. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?

        public init(ecrRepositoryPrefix: String, registryId: String? = nil) {
            self.ecrRepositoryPrefix = ecrRepositoryPrefix
            self.registryId = registryId
        }

        public func validate(name: String) throws {
            try self.validate(self.ecrRepositoryPrefix, name: "ecrRepositoryPrefix", parent: name, max: 20)
            try self.validate(self.ecrRepositoryPrefix, name: "ecrRepositoryPrefix", parent: name, min: 2)
            try self.validate(self.ecrRepositoryPrefix, name: "ecrRepositoryPrefix", parent: name, pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$")
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case ecrRepositoryPrefix
            case registryId
        }
    }

    public struct DeletePullThroughCacheRuleResponse: AWSDecodableShape {
        /// The timestamp associated with the pull through cache rule.
        public let createdAt: Date?
        /// The Amazon ECR repository prefix associated with the request.
        public let ecrRepositoryPrefix: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The upstream registry URL associated with the pull through cache rule.
        public let upstreamRegistryUrl: String?

        public init(createdAt: Date? = nil, ecrRepositoryPrefix: String? = nil, registryId: String? = nil, upstreamRegistryUrl: String? = nil) {
            self.createdAt = createdAt
            self.ecrRepositoryPrefix = ecrRepositoryPrefix
            self.registryId = registryId
            self.upstreamRegistryUrl = upstreamRegistryUrl
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt
            case ecrRepositoryPrefix
            case registryId
            case upstreamRegistryUrl
        }
    }

    public struct DeleteRegistryPolicyRequest: AWSEncodableShape {
        public init() {}
    }

    public struct DeleteRegistryPolicyResponse: AWSDecodableShape {
        /// The contents of the registry permissions policy that was deleted.
        public let policyText: String?
        /// The registry ID associated with the request.
        public let registryId: String?

        public init(policyText: String? = nil, registryId: String? = nil) {
            self.policyText = policyText
            self.registryId = registryId
        }

        private enum CodingKeys: String, CodingKey {
            case policyText
            case registryId
        }
    }

    public struct DeleteRepositoryPolicyRequest: AWSEncodableShape {
        /// The Amazon Web Services account ID associated with the registry that contains the repository policy to delete. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository that is associated with the repository policy to delete.
        public let repositoryName: String

        public init(registryId: String? = nil, repositoryName: String) {
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case registryId
            case repositoryName
        }
    }

    public struct DeleteRepositoryPolicyResponse: AWSDecodableShape {
        /// The JSON repository policy that was deleted from the repository.
        public let policyText: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(policyText: String? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.policyText = policyText
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case policyText
            case registryId
            case repositoryName
        }
    }

    public struct DeleteRepositoryRequest: AWSEncodableShape {
        ///  If a repository contains images, forces the deletion.
        public let force: Bool?
        /// The Amazon Web Services account ID associated with the registry that contains the repository to delete. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository to delete.
        public let repositoryName: String

        public init(force: Bool? = nil, registryId: String? = nil, repositoryName: String) {
            self.force = force
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case force
            case registryId
            case repositoryName
        }
    }

    public struct DeleteRepositoryResponse: AWSDecodableShape {
        /// The repository that was deleted.
        public let repository: Repository?

        public init(repository: Repository? = nil) {
            self.repository = repository
        }

        private enum CodingKeys: String, CodingKey {
            case repository
        }
    }

    public struct DescribeImageReplicationStatusRequest: AWSEncodableShape {
        public let imageId: ImageIdentifier
        /// The Amazon Web Services account ID associated with the registry. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository that the image is in.
        public let repositoryName: String

        public init(imageId: ImageIdentifier, registryId: String? = nil, repositoryName: String) {
            self.imageId = imageId
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.imageId.validate(name: "\(name).imageId")
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case imageId
            case registryId
            case repositoryName
        }
    }

    public struct DescribeImageReplicationStatusResponse: AWSDecodableShape {
        public let imageId: ImageIdentifier?
        /// The replication status details for the images in the specified repository.
        public let replicationStatuses: [ImageReplicationStatus]?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(imageId: ImageIdentifier? = nil, replicationStatuses: [ImageReplicationStatus]? = nil, repositoryName: String? = nil) {
            self.imageId = imageId
            self.replicationStatuses = replicationStatuses
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case imageId
            case replicationStatuses
            case repositoryName
        }
    }

    public struct DescribeImageScanFindingsRequest: AWSEncodableShape {
        public let imageId: ImageIdentifier
        /// The maximum number of image scan results returned by DescribeImageScanFindings in paginated output. When this parameter is used, DescribeImageScanFindings only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeImageScanFindings request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribeImageScanFindings returns up to 100 results and a nextToken value, if applicable.
        public let maxResults: Int?
        /// The nextToken value returned from a previous paginated DescribeImageScanFindings request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
        public let nextToken: String?
        /// The Amazon Web Services account ID associated with the registry that contains the repository in which to describe the image scan findings for. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The repository for the image for which to describe the scan findings.
        public let repositoryName: String

        public init(imageId: ImageIdentifier, maxResults: Int? = nil, nextToken: String? = nil, registryId: String? = nil, repositoryName: String) {
            self.imageId = imageId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.imageId.validate(name: "\(name).imageId")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case imageId
            case maxResults
            case nextToken
            case registryId
            case repositoryName
        }
    }

    public struct DescribeImageScanFindingsResponse: AWSDecodableShape {
        public let imageId: ImageIdentifier?
        /// The information contained in the image scan findings.
        public let imageScanFindings: ImageScanFindings?
        /// The current state of the scan.
        public let imageScanStatus: ImageScanStatus?
        /// The nextToken value to include in a future DescribeImageScanFindings request. When the results of a DescribeImageScanFindings request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(imageId: ImageIdentifier? = nil, imageScanFindings: ImageScanFindings? = nil, imageScanStatus: ImageScanStatus? = nil, nextToken: String? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.imageId = imageId
            self.imageScanFindings = imageScanFindings
            self.imageScanStatus = imageScanStatus
            self.nextToken = nextToken
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case imageId
            case imageScanFindings
            case imageScanStatus
            case nextToken
            case registryId
            case repositoryName
        }
    }

    public struct DescribeImagesFilter: AWSEncodableShape {
        /// The tag status with which to filter your DescribeImages results. You can filter results based on whether they are TAGGED or UNTAGGED.
        public let tagStatus: TagStatus?

        public init(tagStatus: TagStatus? = nil) {
            self.tagStatus = tagStatus
        }

        private enum CodingKeys: String, CodingKey {
            case tagStatus
        }
    }

    public struct DescribeImagesRequest: AWSEncodableShape {
        /// The filter key and value with which to filter your DescribeImages results.
        public let filter: DescribeImagesFilter?
        /// The list of image IDs for the requested repository.
        public let imageIds: [ImageIdentifier]?
        /// The maximum number of repository results returned by DescribeImages in paginated output. When this parameter is used, DescribeImages only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeImages request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribeImages returns up to 100 results and a nextToken value, if applicable. This option cannot be used when you specify images with imageIds.
        public let maxResults: Int?
        /// The nextToken value returned from a previous paginated DescribeImages request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return. This option cannot be used when you specify images with imageIds.
        public let nextToken: String?
        /// The Amazon Web Services account ID associated with the registry that contains the repository in which to describe images. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The repository that contains the images to describe.
        public let repositoryName: String

        public init(filter: DescribeImagesFilter? = nil, imageIds: [ImageIdentifier]? = nil, maxResults: Int? = nil, nextToken: String? = nil, registryId: String? = nil, repositoryName: String) {
            self.filter = filter
            self.imageIds = imageIds
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.imageIds?.forEach {
                try $0.validate(name: "\(name).imageIds[]")
            }
            try self.validate(self.imageIds, name: "imageIds", parent: name, max: 100)
            try self.validate(self.imageIds, name: "imageIds", parent: name, min: 1)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case filter
            case imageIds
            case maxResults
            case nextToken
            case registryId
            case repositoryName
        }
    }

    public struct DescribeImagesResponse: AWSDecodableShape {
        /// A list of ImageDetail objects that contain data about the image.
        public let imageDetails: [ImageDetail]?
        /// The nextToken value to include in a future DescribeImages request. When the results of a DescribeImages request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?

        public init(imageDetails: [ImageDetail]? = nil, nextToken: String? = nil) {
            self.imageDetails = imageDetails
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case imageDetails
            case nextToken
        }
    }

    public struct DescribePullThroughCacheRulesRequest: AWSEncodableShape {
        /// The Amazon ECR repository prefixes associated with the pull through cache rules to return. If no repository prefix value is specified, all pull through cache rules are returned.
        public let ecrRepositoryPrefixes: [String]?
        /// The maximum number of pull through cache rules returned by DescribePullThroughCacheRulesRequest in paginated output. When this parameter is used, DescribePullThroughCacheRulesRequest only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribePullThroughCacheRulesRequest request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribePullThroughCacheRulesRequest returns up to 100 results and a nextToken value, if applicable.
        public let maxResults: Int?
        /// The nextToken value returned from a previous paginated DescribePullThroughCacheRulesRequest request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
        public let nextToken: String?
        /// The Amazon Web Services account ID associated with the registry to return the pull through cache rules for. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?

        public init(ecrRepositoryPrefixes: [String]? = nil, maxResults: Int? = nil, nextToken: String? = nil, registryId: String? = nil) {
            self.ecrRepositoryPrefixes = ecrRepositoryPrefixes
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.registryId = registryId
        }

        public func validate(name: String) throws {
            try self.ecrRepositoryPrefixes?.forEach {
                try validate($0, name: "ecrRepositoryPrefixes[]", parent: name, max: 20)
                try validate($0, name: "ecrRepositoryPrefixes[]", parent: name, min: 2)
                try validate($0, name: "ecrRepositoryPrefixes[]", parent: name, pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$")
            }
            try self.validate(self.ecrRepositoryPrefixes, name: "ecrRepositoryPrefixes", parent: name, max: 100)
            try self.validate(self.ecrRepositoryPrefixes, name: "ecrRepositoryPrefixes", parent: name, min: 1)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case ecrRepositoryPrefixes
            case maxResults
            case nextToken
            case registryId
        }
    }

    public struct DescribePullThroughCacheRulesResponse: AWSDecodableShape {
        /// The nextToken value to include in a future DescribePullThroughCacheRulesRequest request. When the results of a DescribePullThroughCacheRulesRequest request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// The details of the pull through cache rules.
        public let pullThroughCacheRules: [PullThroughCacheRule]?

        public init(nextToken: String? = nil, pullThroughCacheRules: [PullThroughCacheRule]? = nil) {
            self.nextToken = nextToken
            self.pullThroughCacheRules = pullThroughCacheRules
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case pullThroughCacheRules
        }
    }

    public struct DescribeRegistryRequest: AWSEncodableShape {
        public init() {}
    }

    public struct DescribeRegistryResponse: AWSDecodableShape {
        /// The ID of the registry.
        public let registryId: String?
        /// The replication configuration for the registry.
        public let replicationConfiguration: ReplicationConfiguration?

        public init(registryId: String? = nil, replicationConfiguration: ReplicationConfiguration? = nil) {
            self.registryId = registryId
            self.replicationConfiguration = replicationConfiguration
        }

        private enum CodingKeys: String, CodingKey {
            case registryId
            case replicationConfiguration
        }
    }

    public struct DescribeRepositoriesRequest: AWSEncodableShape {
        /// The maximum number of repository results returned by DescribeRepositories in paginated output. When this parameter is used, DescribeRepositories only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeRepositories request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribeRepositories returns up to 100 results and a nextToken value, if applicable. This option cannot be used when you specify repositories with repositoryNames.
        public let maxResults: Int?
        /// The nextToken value returned from a previous paginated DescribeRepositories request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return. This option cannot be used when you specify repositories with repositoryNames.  This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
        public let nextToken: String?
        /// The Amazon Web Services account ID associated with the registry that contains the repositories to be described. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
        public let repositoryNames: [String]?

        public init(maxResults: Int? = nil, nextToken: String? = nil, registryId: String? = nil, repositoryNames: [String]? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.registryId = registryId
            self.repositoryNames = repositoryNames
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.repositoryNames?.forEach {
                try validate($0, name: "repositoryNames[]", parent: name, max: 256)
                try validate($0, name: "repositoryNames[]", parent: name, min: 2)
                try validate($0, name: "repositoryNames[]", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
            }
            try self.validate(self.repositoryNames, name: "repositoryNames", parent: name, max: 100)
            try self.validate(self.repositoryNames, name: "repositoryNames", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults
            case nextToken
            case registryId
            case repositoryNames
        }
    }

    public struct DescribeRepositoriesResponse: AWSDecodableShape {
        /// The nextToken value to include in a future DescribeRepositories request. When the results of a DescribeRepositories request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// A list of repository objects corresponding to valid repositories.
        public let repositories: [Repository]?

        public init(nextToken: String? = nil, repositories: [Repository]? = nil) {
            self.nextToken = nextToken
            self.repositories = repositories
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case repositories
        }
    }

    public struct EncryptionConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The encryption type to use. If you use the KMS encryption type, the contents of the repository will be encrypted using server-side encryption with Key Management Service key stored in KMS. When you use KMS to encrypt your data, you can either use the default Amazon Web Services managed KMS key for Amazon ECR, or specify your own KMS key, which you already created. For more information, see Protecting data using server-side encryption with an KMS key stored in Key Management Service (SSE-KMS) in the Amazon Simple Storage Service Console Developer Guide. If you use the AES256 encryption type, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using an AES-256 encryption algorithm. For more information, see Protecting data using server-side encryption with Amazon S3-managed encryption keys (SSE-S3) in the Amazon Simple Storage Service Console Developer Guide.
        public let encryptionType: EncryptionType
        /// If you use the KMS encryption type, specify the KMS key to use for encryption. The alias, key ID, or full ARN of the KMS key can be specified. The key must exist in the same Region as the repository. If no key is specified, the default Amazon Web Services managed KMS key for Amazon ECR will be used.
        public let kmsKey: String?

        public init(encryptionType: EncryptionType, kmsKey: String? = nil) {
            self.encryptionType = encryptionType
            self.kmsKey = kmsKey
        }

        public func validate(name: String) throws {
            try self.validate(self.kmsKey, name: "kmsKey", parent: name, max: 2048)
            try self.validate(self.kmsKey, name: "kmsKey", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case encryptionType
            case kmsKey
        }
    }

    public struct EnhancedImageScanFinding: AWSDecodableShape {
        /// The Amazon Web Services account ID associated with the image.
        public let awsAccountId: String?
        /// The description of the finding.
        public let description: String?
        /// The Amazon Resource Number (ARN) of the finding.
        public let findingArn: String?
        /// The date and time that the finding was first observed.
        public let firstObservedAt: Date?
        /// The date and time that the finding was last observed.
        public let lastObservedAt: Date?
        /// An object that contains the details of a package vulnerability finding.
        public let packageVulnerabilityDetails: PackageVulnerabilityDetails?
        /// An object that contains the details about how to remediate a finding.
        public let remediation: Remediation?
        /// Contains information on the resources involved in a finding.
        public let resources: [Resource]?
        /// The Amazon Inspector score given to the finding.
        public let score: Double?
        /// An object that contains details of the Amazon Inspector score.
        public let scoreDetails: ScoreDetails?
        /// The severity of the finding.
        public let severity: String?
        /// The status of the finding.
        public let status: String?
        /// The title of the finding.
        public let title: String?
        /// The type of the finding.
        public let type: String?
        /// The date and time the finding was last updated at.
        public let updatedAt: Date?

        public init(awsAccountId: String? = nil, description: String? = nil, findingArn: String? = nil, firstObservedAt: Date? = nil, lastObservedAt: Date? = nil, packageVulnerabilityDetails: PackageVulnerabilityDetails? = nil, remediation: Remediation? = nil, resources: [Resource]? = nil, score: Double? = nil, scoreDetails: ScoreDetails? = nil, severity: String? = nil, status: String? = nil, title: String? = nil, type: String? = nil, updatedAt: Date? = nil) {
            self.awsAccountId = awsAccountId
            self.description = description
            self.findingArn = findingArn
            self.firstObservedAt = firstObservedAt
            self.lastObservedAt = lastObservedAt
            self.packageVulnerabilityDetails = packageVulnerabilityDetails
            self.remediation = remediation
            self.resources = resources
            self.score = score
            self.scoreDetails = scoreDetails
            self.severity = severity
            self.status = status
            self.title = title
            self.type = type
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case awsAccountId
            case description
            case findingArn
            case firstObservedAt
            case lastObservedAt
            case packageVulnerabilityDetails
            case remediation
            case resources
            case score
            case scoreDetails
            case severity
            case status
            case title
            case type
            case updatedAt
        }
    }

    public struct GetAuthorizationTokenRequest: AWSEncodableShape {
        /// A list of Amazon Web Services account IDs that are associated with the registries for which to get AuthorizationData objects. If you do not specify a registry, the default registry is assumed.
        public let registryIds: [String]?

        public init() {
            self.registryIds = nil
        }

        @available(*, deprecated, message: "Members registryIds have been deprecated")
        public init(registryIds: [String]? = nil) {
            self.registryIds = registryIds
        }

        public func validate(name: String) throws {
            try self.registryIds?.forEach {
                try validate($0, name: "registryIds[]", parent: name, pattern: "^[0-9]{12}$")
            }
            try self.validate(self.registryIds, name: "registryIds", parent: name, max: 10)
            try self.validate(self.registryIds, name: "registryIds", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case registryIds
        }
    }

    public struct GetAuthorizationTokenResponse: AWSDecodableShape {
        /// A list of authorization token data objects that correspond to the registryIds values in the request.
        public let authorizationData: [AuthorizationData]?

        public init(authorizationData: [AuthorizationData]? = nil) {
            self.authorizationData = authorizationData
        }

        private enum CodingKeys: String, CodingKey {
            case authorizationData
        }
    }

    public struct GetDownloadUrlForLayerRequest: AWSEncodableShape {
        /// The digest of the image layer to download.
        public let layerDigest: String
        /// The Amazon Web Services account ID associated with the registry that contains the image layer to download. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository that is associated with the image layer to download.
        public let repositoryName: String

        public init(layerDigest: String, registryId: String? = nil, repositoryName: String) {
            self.layerDigest = layerDigest
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.layerDigest, name: "layerDigest", parent: name, pattern: "^[a-zA-Z0-9-_+.]+:[a-fA-F0-9]+$")
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case layerDigest
            case registryId
            case repositoryName
        }
    }

    public struct GetDownloadUrlForLayerResponse: AWSDecodableShape {
        /// The pre-signed Amazon S3 download URL for the requested layer.
        public let downloadUrl: String?
        /// The digest of the image layer to download.
        public let layerDigest: String?

        public init(downloadUrl: String? = nil, layerDigest: String? = nil) {
            self.downloadUrl = downloadUrl
            self.layerDigest = layerDigest
        }

        private enum CodingKeys: String, CodingKey {
            case downloadUrl
            case layerDigest
        }
    }

    public struct GetLifecyclePolicyPreviewRequest: AWSEncodableShape {
        /// An optional parameter that filters results based on image tag status and all tags, if tagged.
        public let filter: LifecyclePolicyPreviewFilter?
        /// The list of imageIDs to be included.
        public let imageIds: [ImageIdentifier]?
        /// The maximum number of repository results returned by GetLifecyclePolicyPreviewRequest in  paginated output. When this parameter is used, GetLifecyclePolicyPreviewRequest only returns  maxResults results in a single page along with a nextToken  response element. The remaining results of the initial request can be seen by sending  another GetLifecyclePolicyPreviewRequest request with the returned nextToken  value. This value can be between 1 and 1000. If this  parameter is not used, then GetLifecyclePolicyPreviewRequest returns up to  100 results and a nextToken value, if  applicable. This option cannot be used when you specify images with imageIds.
        public let maxResults: Int?
        /// The nextToken value returned from a previous paginated  GetLifecyclePolicyPreviewRequest request where maxResults was used and the  results exceeded the value of that parameter. Pagination continues from the end of the  previous results that returned the nextToken value. This value is  null when there are no more results to return. This option cannot be used when you specify images with imageIds.
        public let nextToken: String?
        /// The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository.
        public let repositoryName: String

        public init(filter: LifecyclePolicyPreviewFilter? = nil, imageIds: [ImageIdentifier]? = nil, maxResults: Int? = nil, nextToken: String? = nil, registryId: String? = nil, repositoryName: String) {
            self.filter = filter
            self.imageIds = imageIds
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.imageIds?.forEach {
                try $0.validate(name: "\(name).imageIds[]")
            }
            try self.validate(self.imageIds, name: "imageIds", parent: name, max: 100)
            try self.validate(self.imageIds, name: "imageIds", parent: name, min: 1)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case filter
            case imageIds
            case maxResults
            case nextToken
            case registryId
            case repositoryName
        }
    }

    public struct GetLifecyclePolicyPreviewResponse: AWSDecodableShape {
        /// The JSON lifecycle policy text.
        public let lifecyclePolicyText: String?
        /// The nextToken value to include in a future GetLifecyclePolicyPreview request. When the results of a GetLifecyclePolicyPreview request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// The results of the lifecycle policy preview request.
        public let previewResults: [LifecyclePolicyPreviewResult]?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?
        /// The status of the lifecycle policy preview request.
        public let status: LifecyclePolicyPreviewStatus?
        /// The list of images that is returned as a result of the action.
        public let summary: LifecyclePolicyPreviewSummary?

        public init(lifecyclePolicyText: String? = nil, nextToken: String? = nil, previewResults: [LifecyclePolicyPreviewResult]? = nil, registryId: String? = nil, repositoryName: String? = nil, status: LifecyclePolicyPreviewStatus? = nil, summary: LifecyclePolicyPreviewSummary? = nil) {
            self.lifecyclePolicyText = lifecyclePolicyText
            self.nextToken = nextToken
            self.previewResults = previewResults
            self.registryId = registryId
            self.repositoryName = repositoryName
            self.status = status
            self.summary = summary
        }

        private enum CodingKeys: String, CodingKey {
            case lifecyclePolicyText
            case nextToken
            case previewResults
            case registryId
            case repositoryName
            case status
            case summary
        }
    }

    public struct GetLifecyclePolicyRequest: AWSEncodableShape {
        /// The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository.
        public let repositoryName: String

        public init(registryId: String? = nil, repositoryName: String) {
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case registryId
            case repositoryName
        }
    }

    public struct GetLifecyclePolicyResponse: AWSDecodableShape {
        /// The time stamp of the last time that the lifecycle policy was run.
        public let lastEvaluatedAt: Date?
        /// The JSON lifecycle policy text.
        public let lifecyclePolicyText: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(lastEvaluatedAt: Date? = nil, lifecyclePolicyText: String? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.lastEvaluatedAt = lastEvaluatedAt
            self.lifecyclePolicyText = lifecyclePolicyText
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case lastEvaluatedAt
            case lifecyclePolicyText
            case registryId
            case repositoryName
        }
    }

    public struct GetRegistryPolicyRequest: AWSEncodableShape {
        public init() {}
    }

    public struct GetRegistryPolicyResponse: AWSDecodableShape {
        /// The JSON text of the permissions policy for a registry.
        public let policyText: String?
        /// The ID of the registry.
        public let registryId: String?

        public init(policyText: String? = nil, registryId: String? = nil) {
            self.policyText = policyText
            self.registryId = registryId
        }

        private enum CodingKeys: String, CodingKey {
            case policyText
            case registryId
        }
    }

    public struct GetRegistryScanningConfigurationRequest: AWSEncodableShape {
        public init() {}
    }

    public struct GetRegistryScanningConfigurationResponse: AWSDecodableShape {
        /// The ID of the registry.
        public let registryId: String?
        /// The scanning configuration for the registry.
        public let scanningConfiguration: RegistryScanningConfiguration?

        public init(registryId: String? = nil, scanningConfiguration: RegistryScanningConfiguration? = nil) {
            self.registryId = registryId
            self.scanningConfiguration = scanningConfiguration
        }

        private enum CodingKeys: String, CodingKey {
            case registryId
            case scanningConfiguration
        }
    }

    public struct GetRepositoryPolicyRequest: AWSEncodableShape {
        /// The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository with the policy to retrieve.
        public let repositoryName: String

        public init(registryId: String? = nil, repositoryName: String) {
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case registryId
            case repositoryName
        }
    }

    public struct GetRepositoryPolicyResponse: AWSDecodableShape {
        /// The JSON repository policy text associated with the repository.
        public let policyText: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(policyText: String? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.policyText = policyText
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case policyText
            case registryId
            case repositoryName
        }
    }

    public struct Image: AWSDecodableShape {
        /// An object containing the image tag and image digest associated with an image.
        public let imageId: ImageIdentifier?
        /// The image manifest associated with the image.
        public let imageManifest: String?
        /// The manifest media type of the image.
        public let imageManifestMediaType: String?
        /// The Amazon Web Services account ID associated with the registry containing the image.
        public let registryId: String?
        /// The name of the repository associated with the image.
        public let repositoryName: String?

        public init(imageId: ImageIdentifier? = nil, imageManifest: String? = nil, imageManifestMediaType: String? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.imageId = imageId
            self.imageManifest = imageManifest
            self.imageManifestMediaType = imageManifestMediaType
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case imageId
            case imageManifest
            case imageManifestMediaType
            case registryId
            case repositoryName
        }
    }

    public struct ImageDetail: AWSDecodableShape {
        /// The artifact media type of the image.
        public let artifactMediaType: String?
        /// The sha256 digest of the image manifest.
        public let imageDigest: String?
        /// The media type of the image manifest.
        public let imageManifestMediaType: String?
        /// The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.
        public let imagePushedAt: Date?
        /// A summary of the last completed image scan.
        public let imageScanFindingsSummary: ImageScanFindingsSummary?
        /// The current state of the scan.
        public let imageScanStatus: ImageScanStatus?
        /// The size, in bytes, of the image in the repository. If the image is a manifest list, this will be the max size of all manifests in the list.  Beginning with Docker version 1.9, the Docker client compresses image layers before pushing them to a V2 Docker registry. The output of the docker images command shows the uncompressed image size, so it may return a larger image size than the image sizes returned by DescribeImages.
        public let imageSizeInBytes: Int64?
        /// The list of tags associated with this image.
        public let imageTags: [String]?
        /// The date and time, expressed in standard JavaScript date format, when Amazon ECR recorded the last image pull.  Amazon ECR refreshes the last image pull timestamp at least once every 24 hours. For example, if you pull an image once a day then the lastRecordedPullTime timestamp will indicate the exact time that the image was last pulled. However, if you pull an image once an hour, because Amazon ECR refreshes the lastRecordedPullTime timestamp at least once every 24 hours, the result may not be the exact time that the image was last pulled.
        public let lastRecordedPullTime: Date?
        /// The Amazon Web Services account ID associated with the registry to which this image belongs.
        public let registryId: String?
        /// The name of the repository to which this image belongs.
        public let repositoryName: String?

        public init(artifactMediaType: String? = nil, imageDigest: String? = nil, imageManifestMediaType: String? = nil, imagePushedAt: Date? = nil, imageScanFindingsSummary: ImageScanFindingsSummary? = nil, imageScanStatus: ImageScanStatus? = nil, imageSizeInBytes: Int64? = nil, imageTags: [String]? = nil, lastRecordedPullTime: Date? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.artifactMediaType = artifactMediaType
            self.imageDigest = imageDigest
            self.imageManifestMediaType = imageManifestMediaType
            self.imagePushedAt = imagePushedAt
            self.imageScanFindingsSummary = imageScanFindingsSummary
            self.imageScanStatus = imageScanStatus
            self.imageSizeInBytes = imageSizeInBytes
            self.imageTags = imageTags
            self.lastRecordedPullTime = lastRecordedPullTime
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case artifactMediaType
            case imageDigest
            case imageManifestMediaType
            case imagePushedAt
            case imageScanFindingsSummary
            case imageScanStatus
            case imageSizeInBytes
            case imageTags
            case lastRecordedPullTime
            case registryId
            case repositoryName
        }
    }

    public struct ImageFailure: AWSDecodableShape {
        /// The code associated with the failure.
        public let failureCode: ImageFailureCode?
        /// The reason for the failure.
        public let failureReason: String?
        /// The image ID associated with the failure.
        public let imageId: ImageIdentifier?

        public init(failureCode: ImageFailureCode? = nil, failureReason: String? = nil, imageId: ImageIdentifier? = nil) {
            self.failureCode = failureCode
            self.failureReason = failureReason
            self.imageId = imageId
        }

        private enum CodingKeys: String, CodingKey {
            case failureCode
            case failureReason
            case imageId
        }
    }

    public struct ImageIdentifier: AWSEncodableShape & AWSDecodableShape {
        /// The sha256 digest of the image manifest.
        public let imageDigest: String?
        /// The tag used for the image.
        public let imageTag: String?

        public init(imageDigest: String? = nil, imageTag: String? = nil) {
            self.imageDigest = imageDigest
            self.imageTag = imageTag
        }

        public func validate(name: String) throws {
            try self.validate(self.imageTag, name: "imageTag", parent: name, max: 300)
            try self.validate(self.imageTag, name: "imageTag", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case imageDigest
            case imageTag
        }
    }

    public struct ImageReplicationStatus: AWSDecodableShape {
        /// The failure code for a replication that has failed.
        public let failureCode: String?
        /// The destination Region for the image replication.
        public let region: String?
        /// The Amazon Web Services account ID associated with the registry to which the image belongs.
        public let registryId: String?
        /// The image replication status.
        public let status: ReplicationStatus?

        public init(failureCode: String? = nil, region: String? = nil, registryId: String? = nil, status: ReplicationStatus? = nil) {
            self.failureCode = failureCode
            self.region = region
            self.registryId = registryId
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case failureCode
            case region
            case registryId
            case status
        }
    }

    public struct ImageScanFinding: AWSDecodableShape {
        /// A collection of attributes of the host from which the finding is generated.
        public let attributes: [Attribute]?
        /// The description of the finding.
        public let description: String?
        /// The name associated with the finding, usually a CVE number.
        public let name: String?
        /// The finding severity.
        public let severity: FindingSeverity?
        /// A link containing additional details about the security vulnerability.
        public let uri: String?

        public init(attributes: [Attribute]? = nil, description: String? = nil, name: String? = nil, severity: FindingSeverity? = nil, uri: String? = nil) {
            self.attributes = attributes
            self.description = description
            self.name = name
            self.severity = severity
            self.uri = uri
        }

        private enum CodingKeys: String, CodingKey {
            case attributes
            case description
            case name
            case severity
            case uri
        }
    }

    public struct ImageScanFindings: AWSDecodableShape {
        /// Details about the enhanced scan findings from Amazon Inspector.
        public let enhancedFindings: [EnhancedImageScanFinding]?
        /// The findings from the image scan.
        public let findings: [ImageScanFinding]?
        /// The image vulnerability counts, sorted by severity.
        public let findingSeverityCounts: [FindingSeverity: Int]?
        /// The time of the last completed image scan.
        public let imageScanCompletedAt: Date?
        /// The time when the vulnerability data was last scanned.
        public let vulnerabilitySourceUpdatedAt: Date?

        public init(enhancedFindings: [EnhancedImageScanFinding]? = nil, findings: [ImageScanFinding]? = nil, findingSeverityCounts: [FindingSeverity: Int]? = nil, imageScanCompletedAt: Date? = nil, vulnerabilitySourceUpdatedAt: Date? = nil) {
            self.enhancedFindings = enhancedFindings
            self.findings = findings
            self.findingSeverityCounts = findingSeverityCounts
            self.imageScanCompletedAt = imageScanCompletedAt
            self.vulnerabilitySourceUpdatedAt = vulnerabilitySourceUpdatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case enhancedFindings
            case findings
            case findingSeverityCounts
            case imageScanCompletedAt
            case vulnerabilitySourceUpdatedAt
        }
    }

    public struct ImageScanFindingsSummary: AWSDecodableShape {
        /// The image vulnerability counts, sorted by severity.
        public let findingSeverityCounts: [FindingSeverity: Int]?
        /// The time of the last completed image scan.
        public let imageScanCompletedAt: Date?
        /// The time when the vulnerability data was last scanned.
        public let vulnerabilitySourceUpdatedAt: Date?

        public init(findingSeverityCounts: [FindingSeverity: Int]? = nil, imageScanCompletedAt: Date? = nil, vulnerabilitySourceUpdatedAt: Date? = nil) {
            self.findingSeverityCounts = findingSeverityCounts
            self.imageScanCompletedAt = imageScanCompletedAt
            self.vulnerabilitySourceUpdatedAt = vulnerabilitySourceUpdatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case findingSeverityCounts
            case imageScanCompletedAt
            case vulnerabilitySourceUpdatedAt
        }
    }

    public struct ImageScanStatus: AWSDecodableShape {
        /// The description of the image scan status.
        public let description: String?
        /// The current state of an image scan.
        public let status: ScanStatus?

        public init(description: String? = nil, status: ScanStatus? = nil) {
            self.description = description
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case description
            case status
        }
    }

    public struct ImageScanningConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The setting that determines whether images are scanned after being pushed to a repository. If set to true, images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started with the API_StartImageScan API.
        public let scanOnPush: Bool?

        public init(scanOnPush: Bool? = nil) {
            self.scanOnPush = scanOnPush
        }

        private enum CodingKeys: String, CodingKey {
            case scanOnPush
        }
    }

    public struct InitiateLayerUploadRequest: AWSEncodableShape {
        /// The Amazon Web Services account ID associated with the registry to which you intend to upload layers. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository to which you intend to upload layers.
        public let repositoryName: String

        public init(registryId: String? = nil, repositoryName: String) {
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case registryId
            case repositoryName
        }
    }

    public struct InitiateLayerUploadResponse: AWSDecodableShape {
        /// The size, in bytes, that Amazon ECR expects future layer part uploads to be.
        public let partSize: Int64?
        /// The upload ID for the layer upload. This parameter is passed to further UploadLayerPart and CompleteLayerUpload operations.
        public let uploadId: String?

        public init(partSize: Int64? = nil, uploadId: String? = nil) {
            self.partSize = partSize
            self.uploadId = uploadId
        }

        private enum CodingKeys: String, CodingKey {
            case partSize
            case uploadId
        }
    }

    public struct Layer: AWSDecodableShape {
        /// The availability status of the image layer.
        public let layerAvailability: LayerAvailability?
        /// The sha256 digest of the image layer.
        public let layerDigest: String?
        /// The size, in bytes, of the image layer.
        public let layerSize: Int64?
        /// The media type of the layer, such as application/vnd.docker.image.rootfs.diff.tar.gzip or application/vnd.oci.image.layer.v1.tar+gzip.
        public let mediaType: String?

        public init(layerAvailability: LayerAvailability? = nil, layerDigest: String? = nil, layerSize: Int64? = nil, mediaType: String? = nil) {
            self.layerAvailability = layerAvailability
            self.layerDigest = layerDigest
            self.layerSize = layerSize
            self.mediaType = mediaType
        }

        private enum CodingKeys: String, CodingKey {
            case layerAvailability
            case layerDigest
            case layerSize
            case mediaType
        }
    }

    public struct LayerFailure: AWSDecodableShape {
        /// The failure code associated with the failure.
        public let failureCode: LayerFailureCode?
        /// The reason for the failure.
        public let failureReason: String?
        /// The layer digest associated with the failure.
        public let layerDigest: String?

        public init(failureCode: LayerFailureCode? = nil, failureReason: String? = nil, layerDigest: String? = nil) {
            self.failureCode = failureCode
            self.failureReason = failureReason
            self.layerDigest = layerDigest
        }

        private enum CodingKeys: String, CodingKey {
            case failureCode
            case failureReason
            case layerDigest
        }
    }

    public struct LifecyclePolicyPreviewFilter: AWSEncodableShape {
        /// The tag status of the image.
        public let tagStatus: TagStatus?

        public init(tagStatus: TagStatus? = nil) {
            self.tagStatus = tagStatus
        }

        private enum CodingKeys: String, CodingKey {
            case tagStatus
        }
    }

    public struct LifecyclePolicyPreviewResult: AWSDecodableShape {
        /// The type of action to be taken.
        public let action: LifecyclePolicyRuleAction?
        /// The priority of the applied rule.
        public let appliedRulePriority: Int?
        /// The sha256 digest of the image manifest.
        public let imageDigest: String?
        /// The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.
        public let imagePushedAt: Date?
        /// The list of tags associated with this image.
        public let imageTags: [String]?

        public init(action: LifecyclePolicyRuleAction? = nil, appliedRulePriority: Int? = nil, imageDigest: String? = nil, imagePushedAt: Date? = nil, imageTags: [String]? = nil) {
            self.action = action
            self.appliedRulePriority = appliedRulePriority
            self.imageDigest = imageDigest
            self.imagePushedAt = imagePushedAt
            self.imageTags = imageTags
        }

        private enum CodingKeys: String, CodingKey {
            case action
            case appliedRulePriority
            case imageDigest
            case imagePushedAt
            case imageTags
        }
    }

    public struct LifecyclePolicyPreviewSummary: AWSDecodableShape {
        /// The number of expiring images.
        public let expiringImageTotalCount: Int?

        public init(expiringImageTotalCount: Int? = nil) {
            self.expiringImageTotalCount = expiringImageTotalCount
        }

        private enum CodingKeys: String, CodingKey {
            case expiringImageTotalCount
        }
    }

    public struct LifecyclePolicyRuleAction: AWSDecodableShape {
        /// The type of action to be taken.
        public let type: ImageActionType?

        public init(type: ImageActionType? = nil) {
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case type
        }
    }

    public struct ListImagesFilter: AWSEncodableShape {
        /// The tag status with which to filter your ListImages results. You can filter results based on whether they are TAGGED or UNTAGGED.
        public let tagStatus: TagStatus?

        public init(tagStatus: TagStatus? = nil) {
            self.tagStatus = tagStatus
        }

        private enum CodingKeys: String, CodingKey {
            case tagStatus
        }
    }

    public struct ListImagesRequest: AWSEncodableShape {
        /// The filter key and value with which to filter your ListImages results.
        public let filter: ListImagesFilter?
        /// The maximum number of image results returned by ListImages in paginated output. When this parameter is used, ListImages only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another ListImages request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then ListImages returns up to 100 results and a nextToken value, if applicable.
        public let maxResults: Int?
        /// The nextToken value returned from a previous paginated ListImages request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.  This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
        public let nextToken: String?
        /// The Amazon Web Services account ID associated with the registry that contains the repository in which to list images. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The repository with image IDs to be listed.
        public let repositoryName: String

        public init(filter: ListImagesFilter? = nil, maxResults: Int? = nil, nextToken: String? = nil, registryId: String? = nil, repositoryName: String) {
            self.filter = filter
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case filter
            case maxResults
            case nextToken
            case registryId
            case repositoryName
        }
    }

    public struct ListImagesResponse: AWSDecodableShape {
        /// The list of image IDs for the requested repository.
        public let imageIds: [ImageIdentifier]?
        /// The nextToken value to include in a future ListImages request. When the results of a ListImages request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?

        public init(imageIds: [ImageIdentifier]? = nil, nextToken: String? = nil) {
            self.imageIds = imageIds
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case imageIds
            case nextToken
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) that identifies the resource for which to list the tags. Currently, the only supported resource is an Amazon ECR repository.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The tags for the resource.
        public let tags: [Tag]?

        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags
        }
    }

    public struct PackageVulnerabilityDetails: AWSDecodableShape {
        /// An object that contains details about the CVSS score of a finding.
        public let cvss: [CvssScore]?
        /// One or more URLs that contain details about this vulnerability type.
        public let referenceUrls: [String]?
        /// One or more vulnerabilities related to the one identified in this finding.
        public let relatedVulnerabilities: [String]?
        /// The source of the vulnerability information.
        public let source: String?
        /// A URL to the source of the vulnerability information.
        public let sourceUrl: String?
        /// The date and time that this vulnerability was first added to the vendor's database.
        public let vendorCreatedAt: Date?
        /// The severity the vendor has given to this vulnerability type.
        public let vendorSeverity: String?
        /// The date and time the vendor last updated this vulnerability in their database.
        public let vendorUpdatedAt: Date?
        /// The ID given to this vulnerability.
        public let vulnerabilityId: String?
        /// The packages impacted by this vulnerability.
        public let vulnerablePackages: [VulnerablePackage]?

        public init(cvss: [CvssScore]? = nil, referenceUrls: [String]? = nil, relatedVulnerabilities: [String]? = nil, source: String? = nil, sourceUrl: String? = nil, vendorCreatedAt: Date? = nil, vendorSeverity: String? = nil, vendorUpdatedAt: Date? = nil, vulnerabilityId: String? = nil, vulnerablePackages: [VulnerablePackage]? = nil) {
            self.cvss = cvss
            self.referenceUrls = referenceUrls
            self.relatedVulnerabilities = relatedVulnerabilities
            self.source = source
            self.sourceUrl = sourceUrl
            self.vendorCreatedAt = vendorCreatedAt
            self.vendorSeverity = vendorSeverity
            self.vendorUpdatedAt = vendorUpdatedAt
            self.vulnerabilityId = vulnerabilityId
            self.vulnerablePackages = vulnerablePackages
        }

        private enum CodingKeys: String, CodingKey {
            case cvss
            case referenceUrls
            case relatedVulnerabilities
            case source
            case sourceUrl
            case vendorCreatedAt
            case vendorSeverity
            case vendorUpdatedAt
            case vulnerabilityId
            case vulnerablePackages
        }
    }

    public struct PullThroughCacheRule: AWSDecodableShape {
        /// The date and time the pull through cache was created.
        public let createdAt: Date?
        /// The Amazon ECR repository prefix associated with the pull through cache rule.
        public let ecrRepositoryPrefix: String?
        /// The Amazon Web Services account ID associated with the registry the pull through cache rule is associated with.
        public let registryId: String?
        /// The upstream registry URL associated with the pull through cache rule.
        public let upstreamRegistryUrl: String?

        public init(createdAt: Date? = nil, ecrRepositoryPrefix: String? = nil, registryId: String? = nil, upstreamRegistryUrl: String? = nil) {
            self.createdAt = createdAt
            self.ecrRepositoryPrefix = ecrRepositoryPrefix
            self.registryId = registryId
            self.upstreamRegistryUrl = upstreamRegistryUrl
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt
            case ecrRepositoryPrefix
            case registryId
            case upstreamRegistryUrl
        }
    }

    public struct PutImageRequest: AWSEncodableShape {
        /// The image digest of the image manifest corresponding to the image.
        public let imageDigest: String?
        /// The image manifest corresponding to the image to be uploaded.
        public let imageManifest: String
        /// The media type of the image manifest. If you push an image manifest that does not contain the mediaType field, you must specify the imageManifestMediaType in the request.
        public let imageManifestMediaType: String?
        /// The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI) formats.
        public let imageTag: String?
        /// The Amazon Web Services account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository in which to put the image.
        public let repositoryName: String

        public init(imageDigest: String? = nil, imageManifest: String, imageManifestMediaType: String? = nil, imageTag: String? = nil, registryId: String? = nil, repositoryName: String) {
            self.imageDigest = imageDigest
            self.imageManifest = imageManifest
            self.imageManifestMediaType = imageManifestMediaType
            self.imageTag = imageTag
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.imageManifest, name: "imageManifest", parent: name, max: 4_194_304)
            try self.validate(self.imageManifest, name: "imageManifest", parent: name, min: 1)
            try self.validate(self.imageTag, name: "imageTag", parent: name, max: 300)
            try self.validate(self.imageTag, name: "imageTag", parent: name, min: 1)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case imageDigest
            case imageManifest
            case imageManifestMediaType
            case imageTag
            case registryId
            case repositoryName
        }
    }

    public struct PutImageResponse: AWSDecodableShape {
        /// Details of the image uploaded.
        public let image: Image?

        public init(image: Image? = nil) {
            self.image = image
        }

        private enum CodingKeys: String, CodingKey {
            case image
        }
    }

    public struct PutImageScanningConfigurationRequest: AWSEncodableShape {
        /// The image scanning configuration for the repository. This setting determines whether images are scanned for known vulnerabilities after being pushed to the repository.
        public let imageScanningConfiguration: ImageScanningConfiguration
        /// The Amazon Web Services account ID associated with the registry that contains the repository in which to update the image scanning configuration setting. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository in which to update the image scanning configuration setting.
        public let repositoryName: String

        public init(imageScanningConfiguration: ImageScanningConfiguration, registryId: String? = nil, repositoryName: String) {
            self.imageScanningConfiguration = imageScanningConfiguration
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case imageScanningConfiguration
            case registryId
            case repositoryName
        }
    }

    public struct PutImageScanningConfigurationResponse: AWSDecodableShape {
        /// The image scanning configuration setting for the repository.
        public let imageScanningConfiguration: ImageScanningConfiguration?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(imageScanningConfiguration: ImageScanningConfiguration? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.imageScanningConfiguration = imageScanningConfiguration
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case imageScanningConfiguration
            case registryId
            case repositoryName
        }
    }

    public struct PutImageTagMutabilityRequest: AWSEncodableShape {
        /// The tag mutability setting for the repository. If MUTABLE is specified, image tags can be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.
        public let imageTagMutability: ImageTagMutability
        /// The Amazon Web Services account ID associated with the registry that contains the repository in which to update the image tag mutability settings. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository in which to update the image tag mutability settings.
        public let repositoryName: String

        public init(imageTagMutability: ImageTagMutability, registryId: String? = nil, repositoryName: String) {
            self.imageTagMutability = imageTagMutability
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case imageTagMutability
            case registryId
            case repositoryName
        }
    }

    public struct PutImageTagMutabilityResponse: AWSDecodableShape {
        /// The image tag mutability setting for the repository.
        public let imageTagMutability: ImageTagMutability?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(imageTagMutability: ImageTagMutability? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.imageTagMutability = imageTagMutability
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case imageTagMutability
            case registryId
            case repositoryName
        }
    }

    public struct PutLifecyclePolicyRequest: AWSEncodableShape {
        /// The JSON repository policy text to apply to the repository.
        public let lifecyclePolicyText: String
        /// The Amazon Web Services account ID associated with the registry that contains the repository. If you do  not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository to receive the policy.
        public let repositoryName: String

        public init(lifecyclePolicyText: String, registryId: String? = nil, repositoryName: String) {
            self.lifecyclePolicyText = lifecyclePolicyText
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.lifecyclePolicyText, name: "lifecyclePolicyText", parent: name, max: 30720)
            try self.validate(self.lifecyclePolicyText, name: "lifecyclePolicyText", parent: name, min: 100)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case lifecyclePolicyText
            case registryId
            case repositoryName
        }
    }

    public struct PutLifecyclePolicyResponse: AWSDecodableShape {
        /// The JSON repository policy text.
        public let lifecyclePolicyText: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(lifecyclePolicyText: String? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.lifecyclePolicyText = lifecyclePolicyText
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case lifecyclePolicyText
            case registryId
            case repositoryName
        }
    }

    public struct PutRegistryPolicyRequest: AWSEncodableShape {
        /// The JSON policy text to apply to your registry. The policy text follows the same format as IAM policy text. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide.
        public let policyText: String

        public init(policyText: String) {
            self.policyText = policyText
        }

        public func validate(name: String) throws {
            try self.validate(self.policyText, name: "policyText", parent: name, max: 10240)
        }

        private enum CodingKeys: String, CodingKey {
            case policyText
        }
    }

    public struct PutRegistryPolicyResponse: AWSDecodableShape {
        /// The JSON policy text for your registry.
        public let policyText: String?
        /// The registry ID.
        public let registryId: String?

        public init(policyText: String? = nil, registryId: String? = nil) {
            self.policyText = policyText
            self.registryId = registryId
        }

        private enum CodingKeys: String, CodingKey {
            case policyText
            case registryId
        }
    }

    public struct PutRegistryScanningConfigurationRequest: AWSEncodableShape {
        /// The scanning rules to use for the registry. A scanning rule is used to determine which repository filters are used and at what frequency scanning will occur.
        public let rules: [RegistryScanningRule]?
        /// The scanning type to set for the registry. When a registry scanning configuration is not defined, by default the BASIC scan type is used. When basic scanning is used, you may specify filters to determine which individual repositories, or all repositories, are scanned when new images are pushed to those repositories. Alternatively, you can do manual scans of images with basic scanning. When the ENHANCED scan type is set, Amazon Inspector provides automated vulnerability scanning. You may choose between continuous scanning or scan on push and you may specify filters to determine which individual repositories, or all repositories, are scanned.
        public let scanType: ScanType?

        public init(rules: [RegistryScanningRule]? = nil, scanType: ScanType? = nil) {
            self.rules = rules
            self.scanType = scanType
        }

        public func validate(name: String) throws {
            try self.rules?.forEach {
                try $0.validate(name: "\(name).rules[]")
            }
            try self.validate(self.rules, name: "rules", parent: name, max: 2)
        }

        private enum CodingKeys: String, CodingKey {
            case rules
            case scanType
        }
    }

    public struct PutRegistryScanningConfigurationResponse: AWSDecodableShape {
        /// The scanning configuration for your registry.
        public let registryScanningConfiguration: RegistryScanningConfiguration?

        public init(registryScanningConfiguration: RegistryScanningConfiguration? = nil) {
            self.registryScanningConfiguration = registryScanningConfiguration
        }

        private enum CodingKeys: String, CodingKey {
            case registryScanningConfiguration
        }
    }

    public struct PutReplicationConfigurationRequest: AWSEncodableShape {
        /// An object representing the replication configuration for a registry.
        public let replicationConfiguration: ReplicationConfiguration

        public init(replicationConfiguration: ReplicationConfiguration) {
            self.replicationConfiguration = replicationConfiguration
        }

        public func validate(name: String) throws {
            try self.replicationConfiguration.validate(name: "\(name).replicationConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case replicationConfiguration
        }
    }

    public struct PutReplicationConfigurationResponse: AWSDecodableShape {
        /// The contents of the replication configuration for the registry.
        public let replicationConfiguration: ReplicationConfiguration?

        public init(replicationConfiguration: ReplicationConfiguration? = nil) {
            self.replicationConfiguration = replicationConfiguration
        }

        private enum CodingKeys: String, CodingKey {
            case replicationConfiguration
        }
    }

    public struct Recommendation: AWSDecodableShape {
        /// The recommended course of action to remediate the finding.
        public let text: String?
        /// The URL address to the CVE remediation recommendations.
        public let url: String?

        public init(text: String? = nil, url: String? = nil) {
            self.text = text
            self.url = url
        }

        private enum CodingKeys: String, CodingKey {
            case text
            case url
        }
    }

    public struct RegistryScanningConfiguration: AWSDecodableShape {
        /// The scanning rules associated with the registry.
        public let rules: [RegistryScanningRule]?
        /// The type of scanning configured for the registry.
        public let scanType: ScanType?

        public init(rules: [RegistryScanningRule]? = nil, scanType: ScanType? = nil) {
            self.rules = rules
            self.scanType = scanType
        }

        private enum CodingKeys: String, CodingKey {
            case rules
            case scanType
        }
    }

    public struct RegistryScanningRule: AWSEncodableShape & AWSDecodableShape {
        /// The repository filters associated with the scanning configuration for a private registry.
        public let repositoryFilters: [ScanningRepositoryFilter]
        /// The frequency that scans are performed at for a private registry. When the ENHANCED scan type is specified, the supported scan frequencies are CONTINUOUS_SCAN and SCAN_ON_PUSH. When the BASIC scan type is specified, the SCAN_ON_PUSH and MANUAL scan frequencies are supported.
        public let scanFrequency: ScanFrequency

        public init(repositoryFilters: [ScanningRepositoryFilter], scanFrequency: ScanFrequency) {
            self.repositoryFilters = repositoryFilters
            self.scanFrequency = scanFrequency
        }

        public func validate(name: String) throws {
            try self.repositoryFilters.forEach {
                try $0.validate(name: "\(name).repositoryFilters[]")
            }
            try self.validate(self.repositoryFilters, name: "repositoryFilters", parent: name, max: 100)
        }

        private enum CodingKeys: String, CodingKey {
            case repositoryFilters
            case scanFrequency
        }
    }

    public struct Remediation: AWSDecodableShape {
        /// An object that contains information about the recommended course of action to remediate the finding.
        public let recommendation: Recommendation?

        public init(recommendation: Recommendation? = nil) {
            self.recommendation = recommendation
        }

        private enum CodingKeys: String, CodingKey {
            case recommendation
        }
    }

    public struct ReplicationConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// An array of objects representing the replication destinations and repository filters for a replication configuration.
        public let rules: [ReplicationRule]

        public init(rules: [ReplicationRule]) {
            self.rules = rules
        }

        public func validate(name: String) throws {
            try self.rules.forEach {
                try $0.validate(name: "\(name).rules[]")
            }
            try self.validate(self.rules, name: "rules", parent: name, max: 10)
        }

        private enum CodingKeys: String, CodingKey {
            case rules
        }
    }

    public struct ReplicationDestination: AWSEncodableShape & AWSDecodableShape {
        /// The Region to replicate to.
        public let region: String
        /// The Amazon Web Services account ID of the Amazon ECR private registry to replicate to. When configuring cross-Region replication within your own registry, specify your own account ID.
        public let registryId: String

        public init(region: String, registryId: String) {
            self.region = region
            self.registryId = registryId
        }

        public func validate(name: String) throws {
            try self.validate(self.region, name: "region", parent: name, max: 25)
            try self.validate(self.region, name: "region", parent: name, min: 2)
            try self.validate(self.region, name: "region", parent: name, pattern: "^[0-9a-z-]{2,25}$")
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case region
            case registryId
        }
    }

    public struct ReplicationRule: AWSEncodableShape & AWSDecodableShape {
        /// An array of objects representing the destination for a replication rule.
        public let destinations: [ReplicationDestination]
        /// An array of objects representing the filters for a replication rule. Specifying a repository filter for a replication rule provides a method for controlling which repositories in a private registry are replicated.
        public let repositoryFilters: [RepositoryFilter]?

        public init(destinations: [ReplicationDestination], repositoryFilters: [RepositoryFilter]? = nil) {
            self.destinations = destinations
            self.repositoryFilters = repositoryFilters
        }

        public func validate(name: String) throws {
            try self.destinations.forEach {
                try $0.validate(name: "\(name).destinations[]")
            }
            try self.validate(self.destinations, name: "destinations", parent: name, max: 25)
            try self.repositoryFilters?.forEach {
                try $0.validate(name: "\(name).repositoryFilters[]")
            }
            try self.validate(self.repositoryFilters, name: "repositoryFilters", parent: name, max: 100)
            try self.validate(self.repositoryFilters, name: "repositoryFilters", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case destinations
            case repositoryFilters
        }
    }

    public struct Repository: AWSDecodableShape {
        /// The date and time, in JavaScript date format, when the repository was created.
        public let createdAt: Date?
        /// The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
        public let encryptionConfiguration: EncryptionConfiguration?
        public let imageScanningConfiguration: ImageScanningConfiguration?
        /// The tag mutability setting for the repository.
        public let imageTagMutability: ImageTagMutability?
        /// The Amazon Web Services account ID associated with the registry that contains the repository.
        public let registryId: String?
        /// The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the repository, Amazon Web Services account ID of the repository owner, repository namespace, and repository name. For example, arn:aws:ecr:region:012345678910:repository/test.
        public let repositoryArn: String?
        /// The name of the repository.
        public let repositoryName: String?
        /// The URI for the repository. You can use this URI for container image push and pull operations.
        public let repositoryUri: String?

        public init(createdAt: Date? = nil, encryptionConfiguration: EncryptionConfiguration? = nil, imageScanningConfiguration: ImageScanningConfiguration? = nil, imageTagMutability: ImageTagMutability? = nil, registryId: String? = nil, repositoryArn: String? = nil, repositoryName: String? = nil, repositoryUri: String? = nil) {
            self.createdAt = createdAt
            self.encryptionConfiguration = encryptionConfiguration
            self.imageScanningConfiguration = imageScanningConfiguration
            self.imageTagMutability = imageTagMutability
            self.registryId = registryId
            self.repositoryArn = repositoryArn
            self.repositoryName = repositoryName
            self.repositoryUri = repositoryUri
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt
            case encryptionConfiguration
            case imageScanningConfiguration
            case imageTagMutability
            case registryId
            case repositoryArn
            case repositoryName
            case repositoryUri
        }
    }

    public struct RepositoryFilter: AWSEncodableShape & AWSDecodableShape {
        /// The repository filter details. When the PREFIX_MATCH filter type is specified, this value is required and should be the repository name prefix to configure replication for.
        public let filter: String
        /// The repository filter type. The only supported value is PREFIX_MATCH, which is a repository name prefix specified with the filter parameter.
        public let filterType: RepositoryFilterType

        public init(filter: String, filterType: RepositoryFilterType) {
            self.filter = filter
            self.filterType = filterType
        }

        public func validate(name: String) throws {
            try self.validate(self.filter, name: "filter", parent: name, max: 256)
            try self.validate(self.filter, name: "filter", parent: name, min: 2)
            try self.validate(self.filter, name: "filter", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]*)*/)*[a-z0-9]*(?:[._-][a-z0-9]*)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case filter
            case filterType
        }
    }

    public struct RepositoryScanningConfiguration: AWSDecodableShape {
        /// The scan filters applied to the repository.
        public let appliedScanFilters: [ScanningRepositoryFilter]?
        /// The ARN of the repository.
        public let repositoryArn: String?
        /// The name of the repository.
        public let repositoryName: String?
        /// The scan frequency for the repository.
        public let scanFrequency: ScanFrequency?
        /// Whether or not scan on push is configured for the repository.
        public let scanOnPush: Bool?

        public init(appliedScanFilters: [ScanningRepositoryFilter]? = nil, repositoryArn: String? = nil, repositoryName: String? = nil, scanFrequency: ScanFrequency? = nil, scanOnPush: Bool? = nil) {
            self.appliedScanFilters = appliedScanFilters
            self.repositoryArn = repositoryArn
            self.repositoryName = repositoryName
            self.scanFrequency = scanFrequency
            self.scanOnPush = scanOnPush
        }

        private enum CodingKeys: String, CodingKey {
            case appliedScanFilters
            case repositoryArn
            case repositoryName
            case scanFrequency
            case scanOnPush
        }
    }

    public struct RepositoryScanningConfigurationFailure: AWSDecodableShape {
        /// The failure code.
        public let failureCode: ScanningConfigurationFailureCode?
        /// The reason for the failure.
        public let failureReason: String?
        /// The name of the repository.
        public let repositoryName: String?

        public init(failureCode: ScanningConfigurationFailureCode? = nil, failureReason: String? = nil, repositoryName: String? = nil) {
            self.failureCode = failureCode
            self.failureReason = failureReason
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case failureCode
            case failureReason
            case repositoryName
        }
    }

    public struct Resource: AWSDecodableShape {
        /// An object that contains details about the resource involved in a finding.
        public let details: ResourceDetails?
        /// The ID of the resource.
        public let id: String?
        /// The tags attached to the resource.
        public let tags: [String: String]?
        /// The type of resource.
        public let type: String?

        public init(details: ResourceDetails? = nil, id: String? = nil, tags: [String: String]? = nil, type: String? = nil) {
            self.details = details
            self.id = id
            self.tags = tags
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case id
            case tags
            case type
        }
    }

    public struct ResourceDetails: AWSDecodableShape {
        /// An object that contains details about the Amazon ECR container image involved in the finding.
        public let awsEcrContainerImage: AwsEcrContainerImageDetails?

        public init(awsEcrContainerImage: AwsEcrContainerImageDetails? = nil) {
            self.awsEcrContainerImage = awsEcrContainerImage
        }

        private enum CodingKeys: String, CodingKey {
            case awsEcrContainerImage
        }
    }

    public struct ScanningRepositoryFilter: AWSEncodableShape & AWSDecodableShape {
        /// The filter to use when scanning.
        public let filter: String
        /// The type associated with the filter.
        public let filterType: ScanningRepositoryFilterType

        public init(filter: String, filterType: ScanningRepositoryFilterType) {
            self.filter = filter
            self.filterType = filterType
        }

        public func validate(name: String) throws {
            try self.validate(self.filter, name: "filter", parent: name, max: 255)
            try self.validate(self.filter, name: "filter", parent: name, min: 1)
            try self.validate(self.filter, name: "filter", parent: name, pattern: "^[a-z0-9*](?:[._\\-/a-z0-9*]?[a-z0-9*]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case filter
            case filterType
        }
    }

    public struct ScoreDetails: AWSDecodableShape {
        /// An object that contains details about the CVSS score given to a finding.
        public let cvss: CvssScoreDetails?

        public init(cvss: CvssScoreDetails? = nil) {
            self.cvss = cvss
        }

        private enum CodingKeys: String, CodingKey {
            case cvss
        }
    }

    public struct SetRepositoryPolicyRequest: AWSEncodableShape {
        /// If the policy you are attempting to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This is intended to prevent accidental repository lock outs.
        public let force: Bool?
        /// The JSON repository policy text to apply to the repository. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide.
        public let policyText: String
        /// The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository to receive the policy.
        public let repositoryName: String

        public init(force: Bool? = nil, policyText: String, registryId: String? = nil, repositoryName: String) {
            self.force = force
            self.policyText = policyText
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.policyText, name: "policyText", parent: name, max: 10240)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case force
            case policyText
            case registryId
            case repositoryName
        }
    }

    public struct SetRepositoryPolicyResponse: AWSDecodableShape {
        /// The JSON repository policy text applied to the repository.
        public let policyText: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(policyText: String? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.policyText = policyText
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case policyText
            case registryId
            case repositoryName
        }
    }

    public struct StartImageScanRequest: AWSEncodableShape {
        public let imageId: ImageIdentifier
        /// The Amazon Web Services account ID associated with the registry that contains the repository in which to start an image scan request. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository that contains the images to scan.
        public let repositoryName: String

        public init(imageId: ImageIdentifier, registryId: String? = nil, repositoryName: String) {
            self.imageId = imageId
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.imageId.validate(name: "\(name).imageId")
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case imageId
            case registryId
            case repositoryName
        }
    }

    public struct StartImageScanResponse: AWSDecodableShape {
        public let imageId: ImageIdentifier?
        /// The current state of the scan.
        public let imageScanStatus: ImageScanStatus?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?

        public init(imageId: ImageIdentifier? = nil, imageScanStatus: ImageScanStatus? = nil, registryId: String? = nil, repositoryName: String? = nil) {
            self.imageId = imageId
            self.imageScanStatus = imageScanStatus
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        private enum CodingKeys: String, CodingKey {
            case imageId
            case imageScanStatus
            case registryId
            case repositoryName
        }
    }

    public struct StartLifecyclePolicyPreviewRequest: AWSEncodableShape {
        /// The policy to be evaluated against. If you do not specify a policy, the current policy for the repository is used.
        public let lifecyclePolicyText: String?
        /// The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository to be evaluated.
        public let repositoryName: String

        public init(lifecyclePolicyText: String? = nil, registryId: String? = nil, repositoryName: String) {
            self.lifecyclePolicyText = lifecyclePolicyText
            self.registryId = registryId
            self.repositoryName = repositoryName
        }

        public func validate(name: String) throws {
            try self.validate(self.lifecyclePolicyText, name: "lifecyclePolicyText", parent: name, max: 30720)
            try self.validate(self.lifecyclePolicyText, name: "lifecyclePolicyText", parent: name, min: 100)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case lifecyclePolicyText
            case registryId
            case repositoryName
        }
    }

    public struct StartLifecyclePolicyPreviewResponse: AWSDecodableShape {
        /// The JSON repository policy text.
        public let lifecyclePolicyText: String?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?
        /// The status of the lifecycle policy preview request.
        public let status: LifecyclePolicyPreviewStatus?

        public init(lifecyclePolicyText: String? = nil, registryId: String? = nil, repositoryName: String? = nil, status: LifecyclePolicyPreviewStatus? = nil) {
            self.lifecyclePolicyText = lifecyclePolicyText
            self.registryId = registryId
            self.repositoryName = repositoryName
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case lifecyclePolicyText
            case registryId
            case repositoryName
            case status
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
        public let key: String?
        /// A value acts as a descriptor within a tag category (key).
        public let value: String?

        public init(key: String? = nil, value: String? = nil) {
            self.key = key
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the the resource to which to add tags. Currently, the only supported resource is an Amazon ECR repository.
        public let resourceArn: String
        /// The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
        public let tags: [Tag]

        public init(resourceArn: String, tags: [Tag]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
            case tags
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource from which to remove tags. Currently, the only supported resource is an Amazon ECR repository.
        public let resourceArn: String
        /// The keys of the tags to be removed.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
            case tagKeys
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UploadLayerPartRequest: AWSEncodableShape {
        /// The base64-encoded layer part payload.
        public let layerPartBlob: AWSBase64Data
        /// The position of the first byte of the layer part witin the overall image layer.
        public let partFirstByte: Int64
        /// The position of the last byte of the layer part within the overall image layer.
        public let partLastByte: Int64
        /// The Amazon Web Services account ID associated with the registry to which you are uploading layer parts. If you do not specify a registry, the default registry is assumed.
        public let registryId: String?
        /// The name of the repository to which you are uploading layer parts.
        public let repositoryName: String
        /// The upload ID from a previous InitiateLayerUpload operation to associate with the layer part upload.
        public let uploadId: String

        public init(layerPartBlob: AWSBase64Data, partFirstByte: Int64, partLastByte: Int64, registryId: String? = nil, repositoryName: String, uploadId: String) {
            self.layerPartBlob = layerPartBlob
            self.partFirstByte = partFirstByte
            self.partLastByte = partLastByte
            self.registryId = registryId
            self.repositoryName = repositoryName
            self.uploadId = uploadId
        }

        public func validate(name: String) throws {
            try self.validate(self.layerPartBlob, name: "layerPartBlob", parent: name, max: 20_971_520)
            try self.validate(self.partFirstByte, name: "partFirstByte", parent: name, min: 0)
            try self.validate(self.partLastByte, name: "partLastByte", parent: name, min: 0)
            try self.validate(self.registryId, name: "registryId", parent: name, pattern: "^[0-9]{12}$")
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, max: 256)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, min: 2)
            try self.validate(self.repositoryName, name: "repositoryName", parent: name, pattern: "^(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*$")
            try self.validate(self.uploadId, name: "uploadId", parent: name, pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case layerPartBlob
            case partFirstByte
            case partLastByte
            case registryId
            case repositoryName
            case uploadId
        }
    }

    public struct UploadLayerPartResponse: AWSDecodableShape {
        /// The integer value of the last byte received in the request.
        public let lastByteReceived: Int64?
        /// The registry ID associated with the request.
        public let registryId: String?
        /// The repository name associated with the request.
        public let repositoryName: String?
        /// The upload ID associated with the request.
        public let uploadId: String?

        public init(lastByteReceived: Int64? = nil, registryId: String? = nil, repositoryName: String? = nil, uploadId: String? = nil) {
            self.lastByteReceived = lastByteReceived
            self.registryId = registryId
            self.repositoryName = repositoryName
            self.uploadId = uploadId
        }

        private enum CodingKeys: String, CodingKey {
            case lastByteReceived
            case registryId
            case repositoryName
            case uploadId
        }
    }

    public struct VulnerablePackage: AWSDecodableShape {
        /// The architecture of the vulnerable package.
        public let arch: String?
        /// The epoch of the vulnerable package.
        public let epoch: Int?
        /// The file path of the vulnerable package.
        public let filePath: String?
        /// The name of the vulnerable package.
        public let name: String?
        /// The package manager of the vulnerable package.
        public let packageManager: String?
        /// The release of the vulnerable package.
        public let release: String?
        /// The source layer hash of the vulnerable package.
        public let sourceLayerHash: String?
        /// The version of the vulnerable package.
        public let version: String?

        public init(arch: String? = nil, epoch: Int? = nil, filePath: String? = nil, name: String? = nil, packageManager: String? = nil, release: String? = nil, sourceLayerHash: String? = nil, version: String? = nil) {
            self.arch = arch
            self.epoch = epoch
            self.filePath = filePath
            self.name = name
            self.packageManager = packageManager
            self.release = release
            self.sourceLayerHash = sourceLayerHash
            self.version = version
        }

        private enum CodingKeys: String, CodingKey {
            case arch
            case epoch
            case filePath
            case name
            case packageManager
            case release
            case sourceLayerHash
            case version
        }
    }
}

// MARK: - Errors

/// Error enum for ECR
public struct ECRErrorType: AWSErrorType {
    enum Code: String {
        case emptyUploadException = "EmptyUploadException"
        case imageAlreadyExistsException = "ImageAlreadyExistsException"
        case imageDigestDoesNotMatchException = "ImageDigestDoesNotMatchException"
        case imageNotFoundException = "ImageNotFoundException"
        case imageTagAlreadyExistsException = "ImageTagAlreadyExistsException"
        case invalidLayerException = "InvalidLayerException"
        case invalidLayerPartException = "InvalidLayerPartException"
        case invalidParameterException = "InvalidParameterException"
        case invalidTagParameterException = "InvalidTagParameterException"
        case kmsException = "KmsException"
        case layerAlreadyExistsException = "LayerAlreadyExistsException"
        case layerInaccessibleException = "LayerInaccessibleException"
        case layerPartTooSmallException = "LayerPartTooSmallException"
        case layersNotFoundException = "LayersNotFoundException"
        case lifecyclePolicyNotFoundException = "LifecyclePolicyNotFoundException"
        case lifecyclePolicyPreviewInProgressException = "LifecyclePolicyPreviewInProgressException"
        case lifecyclePolicyPreviewNotFoundException = "LifecyclePolicyPreviewNotFoundException"
        case limitExceededException = "LimitExceededException"
        case pullThroughCacheRuleAlreadyExistsException = "PullThroughCacheRuleAlreadyExistsException"
        case pullThroughCacheRuleNotFoundException = "PullThroughCacheRuleNotFoundException"
        case referencedImagesNotFoundException = "ReferencedImagesNotFoundException"
        case registryPolicyNotFoundException = "RegistryPolicyNotFoundException"
        case repositoryAlreadyExistsException = "RepositoryAlreadyExistsException"
        case repositoryNotEmptyException = "RepositoryNotEmptyException"
        case repositoryNotFoundException = "RepositoryNotFoundException"
        case repositoryPolicyNotFoundException = "RepositoryPolicyNotFoundException"
        case scanNotFoundException = "ScanNotFoundException"
        case serverException = "ServerException"
        case tooManyTagsException = "TooManyTagsException"
        case unsupportedImageTypeException = "UnsupportedImageTypeException"
        case unsupportedUpstreamRegistryException = "UnsupportedUpstreamRegistryException"
        case uploadNotFoundException = "UploadNotFoundException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize ECR
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// The specified layer upload does not contain any layer parts.
    public static var emptyUploadException: Self { .init(.emptyUploadException) }
    /// The specified image has already been pushed, and there were no changes to the manifest or image tag after the last push.
    public static var imageAlreadyExistsException: Self { .init(.imageAlreadyExistsException) }
    /// The specified image digest does not match the digest that Amazon ECR calculated for the image.
    public static var imageDigestDoesNotMatchException: Self { .init(.imageDigestDoesNotMatchException) }
    /// The image requested does not exist in the specified repository.
    public static var imageNotFoundException: Self { .init(.imageNotFoundException) }
    /// The specified image is tagged with a tag that already exists. The repository is configured for tag immutability.
    public static var imageTagAlreadyExistsException: Self { .init(.imageTagAlreadyExistsException) }
    /// The layer digest calculation performed by Amazon ECR upon receipt of the image layer does not match the digest specified.
    public static var invalidLayerException: Self { .init(.invalidLayerException) }
    /// The layer part size is not valid, or the first byte specified is not consecutive to the last byte of a previous layer part upload.
    public static var invalidLayerPartException: Self { .init(.invalidLayerPartException) }
    /// The specified parameter is invalid. Review the available parameters for the API request.
    public static var invalidParameterException: Self { .init(.invalidParameterException) }
    /// An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
    public static var invalidTagParameterException: Self { .init(.invalidTagParameterException) }
    /// The operation failed due to a KMS exception.
    public static var kmsException: Self { .init(.kmsException) }
    /// The image layer already exists in the associated repository.
    public static var layerAlreadyExistsException: Self { .init(.layerAlreadyExistsException) }
    /// The specified layer is not available because it is not associated with an image. Unassociated image layers may be cleaned up at any time.
    public static var layerInaccessibleException: Self { .init(.layerInaccessibleException) }
    /// Layer parts must be at least 5 MiB in size.
    public static var layerPartTooSmallException: Self { .init(.layerPartTooSmallException) }
    /// The specified layers could not be found, or the specified layer is not valid for this repository.
    public static var layersNotFoundException: Self { .init(.layersNotFoundException) }
    /// The lifecycle policy could not be found, and no policy is set to the repository.
    public static var lifecyclePolicyNotFoundException: Self { .init(.lifecyclePolicyNotFoundException) }
    /// The previous lifecycle policy preview request has not completed. Wait and try again.
    public static var lifecyclePolicyPreviewInProgressException: Self { .init(.lifecyclePolicyPreviewInProgressException) }
    /// There is no dry run for this repository.
    public static var lifecyclePolicyPreviewNotFoundException: Self { .init(.lifecyclePolicyPreviewNotFoundException) }
    /// The operation did not succeed because it would have exceeded a service limit for your account. For more information, see Amazon ECR service quotas in the Amazon Elastic Container Registry User Guide.
    public static var limitExceededException: Self { .init(.limitExceededException) }
    /// A pull through cache rule with these settings already exists for the private registry.
    public static var pullThroughCacheRuleAlreadyExistsException: Self { .init(.pullThroughCacheRuleAlreadyExistsException) }
    /// The pull through cache rule was not found. Specify a valid pull through cache rule and try again.
    public static var pullThroughCacheRuleNotFoundException: Self { .init(.pullThroughCacheRuleNotFoundException) }
    /// The manifest list is referencing an image that does not exist.
    public static var referencedImagesNotFoundException: Self { .init(.referencedImagesNotFoundException) }
    /// The registry doesn&#39;t have an associated registry policy.
    public static var registryPolicyNotFoundException: Self { .init(.registryPolicyNotFoundException) }
    /// The specified repository already exists in the specified registry.
    public static var repositoryAlreadyExistsException: Self { .init(.repositoryAlreadyExistsException) }
    /// The specified repository contains images. To delete a repository that contains images, you must force the deletion with the force parameter.
    public static var repositoryNotEmptyException: Self { .init(.repositoryNotEmptyException) }
    /// The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.
    public static var repositoryNotFoundException: Self { .init(.repositoryNotFoundException) }
    /// The specified repository and registry combination does not have an associated repository policy.
    public static var repositoryPolicyNotFoundException: Self { .init(.repositoryPolicyNotFoundException) }
    /// The specified image scan could not be found. Ensure that image scanning is enabled on the repository and try again.
    public static var scanNotFoundException: Self { .init(.scanNotFoundException) }
    /// These errors are usually caused by a server-side issue.
    public static var serverException: Self { .init(.serverException) }
    /// The list of tags on the repository is over the limit. The maximum number of tags that can be applied to a repository is 50.
    public static var tooManyTagsException: Self { .init(.tooManyTagsException) }
    /// The image is of a type that cannot be scanned.
    public static var unsupportedImageTypeException: Self { .init(.unsupportedImageTypeException) }
    /// The specified upstream registry isn&#39;t supported.
    public static var unsupportedUpstreamRegistryException: Self { .init(.unsupportedUpstreamRegistryException) }
    /// The upload could not be found, or the specified upload ID is not valid for this repository.
    public static var uploadNotFoundException: Self { .init(.uploadNotFoundException) }
    /// There was an exception validating this request.
    public static var validationException: Self { .init(.validationException) }
}

extension ECRErrorType: Equatable {
    public static func == (lhs: ECRErrorType, rhs: ECRErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension ECRErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
